% relative angle
% vector 1 : [pt1 pt2]
% vector 2 : [pt2 pt3]
function [x_relAngle,len1,len2] = relAngle(pt1,pt2,pt3)
    vect1 = pt2 - pt1;
    vect2 = pt3 - pt2;
    len1 = pdist([pt2(:)';pt1(:)']);
    len2 = pdist([pt3(:)';pt2(:)']);
    cross_pro = cross(vect2,vect1);
    x_relAngle = asin(cross_pro(3)/len1/len2);
end